#include <stdlib.h>
#include <stdio.h>

int main()
{
    double number1 = 0;
    double number2 = 0;
    char operation = 0;
    int flag = 0;
    while (flag != -1)
    {
        printf("\nEnter the calculation:\n");
        scanf("%lf%c%lf", &number1, &operation, &number2);

        switch (operation)
        {
        case '+':
            printf("=%lf\n", number1 + number2);
            break;
        case '-':
            printf("=%lf\n", number1 - number2);
            break;
        case '*':
            printf("=%lf\n", number1 * number2);
            break;
        case '/':
            if (number2 == 0)
            {
                printf("\aDavision by zero error!\n");
            }
            else
                printf("=%lf", number1 / number2);
            break;
        default:
            printf("\n\n\aDavision by zero error!\n");
            break;
        }
        printf("是否推出，退出请输入－１,否则按任意数字键继续\n");
        scanf("%d", &flag);
    }
}